﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<title><{config_item('manager_title')}></title>
	<link href="/public/H-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="/public/H-ui/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="/public/H-ui/hui-iconfont/iconfont.css" rel="stylesheet" type="text/css">
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单管理 <span class="c-gray en">&gt;</span> 订单列表 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20" style="padding-top: 0px;">
	<div class="text-c pt-20">
		<form action="<{site_url('/manager/order/order/')}>" method="post" class="form form-horizontal" id="search" name="search">
			<span class="select-box" style="width:150px">
				<select name="shop_id" class="select">
					<option value="">来源店铺</option>
					<{foreach $shop_list as $k}>
					<option value="<{$k.m_id}>"><{$k.shop_name}></option>
					<{/foreach}>
				</select>
			</span>
			<span class="select-box" style="width:150px">
				<select name="payment_status" class="select">
					<option value="">支付状态</option>
					<option value="0">未支付</option>
					<option value="1">已支付</option>
				</select>
			</span>
			<span class="select-box" style="width:150px">
				<select name="status" class="select">
					<option value="">状态</option>
					<option value="1">待支付</option>
					<option value="2">待发货</option>
					<option value="3">待确认</option>
					<option value="4">待评价</option>
					<option value="5">已评价</option>
					<option value="6">退款</option>
					<option value="7">部分退款</option>
					<option value="8">交易取消</option>
					<option value="9">订单作废</option>
					<option value="10">退款中</option>
				</select>
			</span>
			<span class="select-box" style="width:150px">
				<select name="keyword_where" class="select">
					<option value="">选择条件</option>
					<option value="o.full_name">收货人姓名</option>
					<option value="o.tel">收货人电话</option>
					<option value="o.order_no">订单号</option>
					<option value="m.username">用户名</option>
					<option value="o.id">订单ID</option>
				</select>
			</span>
			<input type="text" name="keyword" style="width:150px" class="input-text">
			<button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
			<button onclick="window.location.href='<{search_array_to_link($search_where)}>&export=1'" class="btn btn-primary" type="button"><i class="Hui-iconfont">&#xe640;</i> 导出</button>
		</form>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">
		<{if $search_where['is_del']==1}>
		<a href="<{site_url('/manager/order/order/')}>" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe678;</i> 返回列表</a>
		<a href="javascript:;" onclick="data_del(this,'<{site_url('/manager/order/order/delete/')}>')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe60b;</i> 彻底删除</a>
		<a href="javascript:;" onclick="data_del(this,'<{site_url('/manager/order/order/reduction_recycle/')}>')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe66b;</i> 还原</a>
		<{else}>
		<a href="javascript:;" onclick="batch_print_distribution();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe652;</i> 批量打印配货单</a>
		<a href="javascript:;" onclick="batch_print_express();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe652;</i> 批量打印快递单</a>
		<a href="javascript:;" onclick="data_del(this,'<{site_url('/manager/order/order/delete_recycle/')}>')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe60b;</i> 批量删除</a>
		<a href="<{site_url('/manager/order/order/')}>?is_del=1" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe6e2;</i> 回收站</a>
		<{/if}>
	</span></div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
			<tr class="text-c">
				<th width="30"><input name="" type="checkbox" value=""></th>
				<th>订单号</th>
				<th width="70">收货人</th>
				<th width="50">支付状态</th>
				<th width="50">订单状态</th>
				<th width="60">打印</th>
				<th width="75">支付方式</th>
				<th width="75">配送方式</th>
				<th width="70">用户名</th>
				<th width="70">下单时间</th>
				<th width="90">操作</th>
			</tr>
			</thead>
			<tbody>
			<{foreach $list as $key}>
			<tr class="text-c">
				<td><input name="id[]" type="checkbox" value="<{$key.id}>"></td>
				<td class="text-l" title="ID:<{$key.id}>"><{$key.order_no}></td>
				<td class="text-l"><{$key.full_name}></td>
				<td class="text-c">
					<{if $key.payment_status==0}>
					<span class="label label-warning radius">未支付</span>
					<{elseif $key.payment_status==1}>
					<span class="label label-success radius">已支付</span>
					<{/if}>
				</td>
				<td class="text-c"><{get_order_status_text($key)}></td>
				<td class="text-c">
					<span class="label label-warning radius"><a target="_blank" style="color: #fff;" href="<{site_url("/manager/order/order/print_distribution/")}>?order_id=<{$key.id}>">配货单</a></span>
					<span class="label label-success radius" style="cursor: pointer;" onClick="open_iframe('选择快递公司','<{site_url("/manager/order/order/print_express_select/")}>?order_id=<{$key.id}>')">快递单</span>
				</td>
				<td class="text-l">
					<{if $key.payment_id==1}>
					货到付款
					<{else}>
					<{$payment_list[$key.payment_id].name}>
					<{/if}></td>
				<td class="text-l"><{$delivery_list[$key.delivery_id].name}></td>
				<td class="text-l"><{$key.username}></td>
				<td class="text-l"><{date('Y-m-d H:i:s',$key.addtime)}></td>
				<td class="f-14 td-manage text-l">
					<a style="text-decoration:none" class="ml-5" onClick="open_iframe('订单详情','<{site_url("/manager/order/order/view/<{$key.id}>")}>','100%')" href="javascript:;" title="订单详情"><i class="Hui-iconfont">&#xe665;</i></a>
					<{if $key.status==1}>
					<a style="text-decoration:none" class="ml-5" onClick="open_iframe('编辑改价','<{site_url("/manager/order/order/edit/<{$key.id}>")}>')" href="javascript:;" title="编辑改价"><i class="Hui-iconfont">&#xe6df;</i></a>
					<{/if}>
					<{if $search_where['is_del']==1}>
					<a style="text-decoration:none" class="ml-5" onClick="data_del(this,'<{site_url('/manager/order/order/delete/')}>','<{$key.id}>')" href="javascript:;" title="彻底删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
					<{else}>
					<a style="text-decoration:none" class="ml-5" onClick="data_del(this,'<{site_url('/manager/order/order/delete_recycle/')}>','<{$key.id}>')" href="javascript:;" title="删除到回收站"><i class="Hui-iconfont">&#xe6e2;</i></a>
					<{/if}>
					<{if $key.shop_id>1}>
					<a style="text-decoration:none" class="ml-5" onClick="open_iframe('查看商家','<{site_url("/manager/member/shop/view/<{$key.shop_id}>")}>','100%')" href="javascript:;" title="查看商家"><i class="Hui-iconfont">&#xe66a;</i></a>
					<{/if}>
				</td>
			</tr>
			<{/foreach}>
			</tbody>
		</table>
	</div>
</div>
<!--分页-->
<{page_view('page',$page_count,search_array_to_link($search_where))}>
<script type="text/javascript" src="/public/js/jquery.js"></script>
<script type="text/javascript" src="/public/js/layer/layer.js"></script>
<script type="text/javascript" src="/public/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/public/js/form.js"></script>
<script type="text/javascript" src="/public/H-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/public/H-ui/js/H-ui.admin.js"></script>
<script language="JavaScript">
	//批量打印配货单
	function batch_print_distribution(){
		var ids = new Array();
		$('[name="id[]"]:checked').each(
			function(i){
				//获取多选框的值
				var idVal = $('[name="id[]"]:checked:eq('+i+')').val();
				ids.push(idVal);
			}
		)
		if(ids==''){
			layer.msg('没有选择任何数据!');
			return false;
		}
		window.open('<{site_url("/manager/order/order/print_distribution/")}>?order_id='+ids.join(','));
	}
	//批量打印快递单
	function batch_print_express(){
		var ids = new Array();
		$('[name="id[]"]:checked').each(
			function(i){
				//获取多选框的值
				var idVal = $('[name="id[]"]:checked:eq('+i+')').val();
				ids.push(idVal);
			}
		)
		open_iframe('订单详情','<{site_url("/manager/order/order/print_express_select/")}>?order_id='+ids.join(','))
	}
	$(function(){
		//表单回填
		var formObj = new Form();
		formObj.init(<{ch_json_encode($search_where)}>);
	})
</script>
</body>
</html>